<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('单据列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>物料编码：</label>
                                <input type="text" name="materialCode"/>
                            </li>
                            <li>
                                <label>批次：</label>
                                <input type="text" name="batch"/>
                            </li>
                            <li>
                                <label>单据状态： </label>
                                <select name="status" th:with="type=${@dict.getType('ct_logistics_status')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.isDefault == 'Y'}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>创建时间： </label>
                                <input type="text" class="time-input" placeholder="创建时间" name="createTime" style="width: 200px;"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-table-fixed-columns-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('system:logistics:sign')}]];
        var prefix = ctx + "system/logistics";
        $(function() {
            var options = {
                url: prefix + "/list",
                updateUrl: prefix + "/sign/{id}",
                modalName: "单据",
                fixedColumns: true,
                fixedRightNumber: 1,
                columns: [{
                    checkbox: false
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'sortNo',
                    title: '序号'
                },
                {
                    field: 'model',
                    title: '型号'
                },
                {
                    field: 'area',
                    title: '面积'
                },
                {
                    field: 'customer',
                    title: '客户'
                },
                {
                    field: 'materialCode',
                    title: '物料编码'
                },
                {
                    field: 'materialName',
                    title: '物料名称'
                },
                {
                    field: 'weight',
                    title: '净重'
                },
                {
                    field: 'sourceCode',
                    title: '源单编号'
                },
                {
                    field: 'count',
                    title: '计数'
                },
                {
                    field: 'packWeight',
                    title: '包装重量'
                },
                {
                    field: 'batch',
                    title: '批次'
                },
                {
                    field: 'organization',
                    title: '发货组织'
                },
                {
                    field: 'width',
                    title: '幅宽'
                },
                {
                    field: 'plasticBox',
                    title: '是否塑料箱'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.signTab(' + row.id + ')"><i class="fa fa-edit"></i>签收</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>